package cn.sumpu.app.guoguojie.dao;

import java.util.List;
import java.util.Map;
import cn.sumpu.app.guoguojie.domain.CmsContent;
import cn.sumpu.app.guoguojie.exception.AppBusinessException;

public interface CmsContentDao {
	
	//添加内容
	void addCmsContent(CmsContent cmsContent)throws AppBusinessException;
	//取得内容列表
	List<CmsContent> getContentList(Map<String, Object> map)throws AppBusinessException;
	//根据频道集合取得内容Id集合
	List<String> getContentIdList(Map<String, Object> map)throws AppBusinessException;
	//更新内容信息
	void updateContentById(CmsContent cmsContent)throws AppBusinessException;
	//根据该频道下有多少条内容
	Integer getContentCount(Map<String, Object> map)throws AppBusinessException;
	// 根据内容Id取得这条内容的信息
	CmsContent getContentById(String identifier)throws AppBusinessException;
	//根据内容Id的集合删除内容
	void deleteContentByIdList(Map<String, Object> map)throws AppBusinessException;
	//根据内容Id删除内容
	void deleteContentById(Map<String, Object> map)throws AppBusinessException;
	//维护编号(type：null.全频道维护 1.删除维护(-1) 2.排序上移(+1) 3.排序下移(-1))
	void updateContentSort(Map<String, Object> map)throws AppBusinessException;
	//全部更新为已发布
	void updateContentAll(Map<String, Object> map)throws AppBusinessException;
	//取得大于当前时间的预约内容
	List<CmsContent> getContentByTime()throws AppBusinessException;
	//取得后台的内容列表
	List<CmsContent> getBackContentList(Map<String, Object> map)throws AppBusinessException;
	//按照时间预览取得内容列表
	List<CmsContent> getContentListByTime(Map<String, Object> map)throws AppBusinessException;
	//编号对调
	void updateContentBySort (Map<String, Object> map)throws AppBusinessException;
	//查询这条微博有没有已经被推送
	int getTblIdentifierCount(Map<String, Object> map)throws AppBusinessException;
	//更改封面
	void updateTagCover(Map<String, Object> map)throws AppBusinessException;
	//首页的格子
	List<CmsContent> getProductGrid(Map<String, Object> map)throws AppBusinessException;
	//这个频道下的所有内容排序都+1
	void updateContentAddOne(Map<String, Object> map)throws AppBusinessException;
	//查询爱心社活动
	List<CmsContent> getLoveActivity(Map<String, Object> map)throws AppBusinessException;
	
	/**
	 * author BruceZhang
	 * @param channel	频道ID
	 * @return	根据频道ID查询这个频道下最小序号
	 * @throws AppBusinessException
	 */
	Integer getMinSortByChannel(String channel)throws AppBusinessException;
	/**
	 * author BruceZhang
	 * @param channel	频道ID
	 * @return	根据频道ID查询这个频道下最大序号
	 * @throws AppBusinessException
	 */
	Integer getMaxSortByChannel(String channel)throws AppBusinessException;
	
	public CmsContent getContentByMap(Map<String, Object> map) throws AppBusinessException;
	
	//帮淘内容列表
	 public List<CmsContent> getAmoysList(Map<String, Object> map)  throws AppBusinessException;
	 //帮淘内容列表页面
	 public List<CmsContent> getCmsContentListForAmoy(Map<String, Object> map)  throws AppBusinessException;
	 public int getCmsContentListForAmoyCount(Map<String, Object> map) throws AppBusinessException;
	
}